class afs::install inherits afs {
  
case $operatingsystem {
/AlmaLinux|almalinux|centos|CentOS/: {
  yumrepo {"afs":
    baseurl  => "http://${mirrorserver}/yum/afs/${facts['os']['release']['full']}",
    descr    => "afs",
    enabled  => 1,
    gpgcheck => 0,
    priority => 20,
    before   => Yumrepo['site']
  }-> 
  if $operatingsystemmajrelease > '7' {
    package{["dkms-openafs","openafs-client","openafs-devel","openafs-authlibs-devel","openafs-krb5","kmod-openafs","pam_krb5","krb5-workstation"]:
      ensure  => installed,
      require => Yumrepo['site']
    }
  } else { 
    $afspkg = [
       "dkms-openafs-1.8.10-1.el7.x86_64",
       "openafs-client-1.8.10-1.el7.x86_64",
       "openafs-authlibs-devel-1.8.10-1.el7.x86_64",
       "openafs-1.8.10-1.el7.x86_64",
       "openafs-devel-1.8.10-1.el7.x86_64",
       "kmod-openafs-1.8.10-1.3.10.0_1160.105.1.el7.x86_64",
       "openafs-krb5-1.8.10-1.el7.x86_64",
       "openafs-authlibs-1.8.10-1.el7.x86_64",
    ]
    package{ $afspkg :
      ensure  => installed,
      require => Yumrepo['site']
    }
  }

  } #end centos
/scientific|Scientific/: {
  case $operatingsystemmajrelease {
    /5|6/: {
      package{["openafs-client","openafs-krb5"]:
          ensure  => installed,
	  require => Yumrepo['site']
      }
    }
    '7':  {
      package{["openafs-1.6-sl-client","openafs-1.6-sl-devel","openafs-1.6-sl-authlibs-devel","openafs-1.6-sl-krb5","pam_krb5","krb5-workstation"]:
          ensure  => installed,
	  require => Yumrepo['site'],
      }
    }
    }
  } #end scientific
}
}
